home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / _GUICtrlComboGetTopIndex.au3 < prev    next >
Text File  |  2006-06-17  |  904b  |  27 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiCombo.au3>
  3.  
  4. Opt('MustDeclareVars',1)
  5.  
  6. Dim $Combo,$Btn_Exit,$Status,$msg,$Btn_Get
  7.  
  8. GuiCreate("ComboBox Get Top Index", 392, 254)
  9.  
  10. $Combo = GuiCtrlCreateCombo("", 70, 10, 270, 100,BitOR($CBS_SIMPLE,$CBS_DISABLENOSCROLL,$WS_VSCROLL))
  11. GUICtrlSetData($Combo,"AutoIt|v3|is|freeware|BASIC-like|scripting|language|designed|for|automating")
  12. $Btn_Get = GuiCtrlCreateButton("Get Top Index", 150, 140, 90, 30)
  13. $Btn_Exit = GuiCtrlCreateButton("Exit", 150, 180, 90, 30)
  14. $Status = GUICtrlCreateLabel("",0,234,392,20,BitOR($SS_SUNKEN,$SS_CENTER))
  15. GUICtrlSetData($Status,"Top Index: " & _GUICtrlComboGetTopIndex($Combo))
  16. GuiSetState()
  17. While 1
  18.     $msg = GuiGetMsg()
  19.     Select
  20.         Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  21.             ExitLoop
  22.         Case $msg = $Btn_Get
  23.             GUICtrlSetData($Status,"Top Index: " & _GUICtrlComboGetTopIndex($Combo))
  24.     EndSelect
  25. WEnd
  26. Exit
  27.